#!/bin/sh 
echo "======== start clean docker containers logs ========"  

logs=$(find /var/lib/docker/containers/ -type f  -mtime +10 -name *-json.log*)  

for log in $logs
        do  
                echo "clean logs : $log"  
                cat /dev/null > $log  
        done  
find /var/lib/docker/containers/ -type f  -size 0 -name *-json.log* |xargs rm -f

echo "======== end clean docker containers logs ========"  